<form id="apartamente-form-<?php echo $form->getObject()->getId()?>" class="apartamente-form" request="<?php echo url_for($form->request) ?>" action="javascript:void(0)" autocomplete="off">
  <?php echo $form->renderHiddenFields() ?>
  <div class="table">
    <table>
      <thead>
        <tr>
          <th class="required-field">Etaj</th>
          <th class="required-field">Nr. ap.</th>
          <th class="required-field">Proprietar</th>
        </tr>
      </thead>
      <tbody>
      <?php foreach ($form[NewApartamentListForm::WRAPPER_NAME] as $apartament): ?>
        <tr>
          <td><?php echo $apartament['etaj']->render() ?></td>
          <td><?php echo $apartament['number']->render() ?></td>
          <td><?php echo $apartament['proprietar']->render() ?></td>
        </tr>
      <?php endforeach; ?>
        <tr>
          <td>
          </td>
        </tr>
      </tbody>
    </table>
  </div>

  <input type="submit" value="Salveaza" />

  <?php if ($form->getObject()->getApartamenteCount()): ?>
    <a id="cancel-apartamente-<?php echo $form->getObject()->getId()?>" request="<?php echo url_for('apartamente/xCancelAddApartamente?scara_id='.$form->getObject()->getId())?>">renunta</a>
  <?php endif; ?>

</form>

<script type="text/javascript">
  ApartamenteForm.init('apartamente-form-<?php echo $form->getObject()->getId()?>');
  ApartamenteForm.cancel('cancel-apartamente-<?php echo $form->getObject()->getId()?>');
</script>

